package com.candy.util;

import com.candy.service.AccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Client1 {
    public static void main(String[] args) {
//ClassPathXmlApplicationContext可以再加类路径下的配置文件
        ApplicationContext ac = new ClassPathXmlApplicationContext("beans.xml");
//可以加载磁盘上的配置文件
        //        ApplicationContext ac=new FileSystemXmlApplicationContext("E:\\beans.xml");
//        创建accountService的bean实例
        AccountService accountService = (AccountService) ac.getBean("accountService");
//       显示依赖注入的结果
        System.out.println(accountService);

    }
}
